﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Web.Mvc;
using Ext.Net;
using Sharp.Domain.PlatformBoundedContext.OrgModule.Aggregates;
using Sharp.Infrastructure;
using Sharp.Platform.Mvc;


namespace Sharp.Web.Models
{
    /// <summary>
    /// 组织机构
    /// </summary>
    public partial class OrgModel : IViewModel
    {
        public OrgModel()
        {
        }
        [HiddenInput]
        public Guid Id { get; set; }

        /// <summary>
        /// 编码
        /// </summary>
        [Display(Name = "编码")]
        public string Code { get; set; }

        /// <summary>
        /// 名称
        /// </summary>
        /// <value>标题</value>
        [Display(Name = "名称")]
        public string Title { get; set; }
        /// <summary>
        /// 简称
        /// </summary>
        [Display(Name = "简称")]
        public string Abbreviation { get; set; }
        [Display(Name = "归属"), CustomField(FieldType.OrgList, "ParentId")]
        public string ParentOrgTitle { get; set; }
        /// <summary>
        /// 上级
        /// </summary>
        public System.Guid? ParentId { get; set; }
        /// <summary>
        /// 层次Id
        /// </summary>
        [Display(Name = "层次")]
        public Guid? OrgLevelId { get; set; }

        /// <summary>
        /// 编制
        /// </summary>
        [Display(Name = "编制")]
        public int? MaxHeadcount { get; set; }


        /// <summary>
        /// 备注
        /// </summary>
        /// <value>备注</value>
        [Display(Name = "备注"), DataType(DataType.MultilineText)]
        public string Remark { get; set; }


        public Node OrgTree { get; set; }
    }
}